package com.hnkywl.sts.action.forScreen;

import com.hnkywl.sts.service.flow.FlowService;
import com.hnkywl.sts.service.report.XslrService;
import com.hnkywl.sts.service.tjbb.YwsfcService;
import net.ruixin.web.struts2.SimpleActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: ccr
 * Date: 13-10-28
 * Time: 下午5:18
 * To change this template use File | Settings | File Templates.
 */
@Namespace("/forScreen")
public class ForScreenAction extends SimpleActionSupport {
    private XslrService xslrService;
    private YwsfcService ywsfcService;
    private FlowService flowService;
    private int pageNo = 1;
    private int pageSize = 8;
    private Map<String, Object> result;

    @Action("t_xslr")
    public String xslr(){
        result = xslrService.xslrListForScreen(pageNo,pageSize);
        return SUCCESS;
    }

    @Action("t_xslrpie")
    public String xslrPie(){
        result = xslrService.findXslrPieForScreen();
        return SUCCESS;
    }

    @Action("t_ywsfc")
    public String ywsfc(){
        result = ywsfcService.ywsfcListForScreen(pageNo,pageSize);
        return SUCCESS;
    }

    @Action("t_spjk")
    public String spjk(){
        result = flowService.findLcspForScreen();
        return SUCCESS;
    }


    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public Map<String, Object> getResult() {
        return result;
    }

    public void setResult(Map<String, Object> result) {
        this.result = result;
    }
    @Autowired
    public void setYwsfcService(YwsfcService ywsfcService) {
        this.ywsfcService = ywsfcService;
    }

    @Autowired
    public void setXslrService(XslrService xslrService) {
        this.xslrService = xslrService;
    }
    @Autowired
    public void setFlowService(FlowService flowService) {
        this.flowService = flowService;
    }
}
